﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Arcadia.Bookasa.Common.Service;
using Arcadia.Bookasa.Common.Storage;
using Arcadia.Bookasa.Persistence.Facade;
using Arcadia.Bookasa.Persistence.Entity;

namespace Bookasa.Configuration
{
    public class DatabaseSetting : BaseServiceExtension, IServiceExtension, IConfiguration 
    {
        protected IFoldersDao FoldersDao { get; set; }
        protected ISettingsDao SettingsDao { get; set; }

        public DatabaseSetting(IFoldersDao foldersDao, ISettingsDao settingsDao)
        {
            this.FoldersDao = foldersDao;
            this.SettingsDao = settingsDao;
        }

        public T GetConfiguationData<T>(string name)
        {
            if (name.Equals("AllFolders", StringComparison.OrdinalIgnoreCase))
            {
                IList<Folders> folders = this.FoldersDao.GetAllFolders();       
     
                T 
            }
            else if (name.Equals("Settings", StringComparison.OrdinalIgnoreCase))
            {
                string value = this.SettingsDao.GetSetting(name).Value;
                
            }
            return default(T);   
        }
    }
}
